//----------------------------------------------------------------------------
// M A R I T I M E  R E S E A R C H  I N S T I T U T E  N E T H E R L A N D S
//----------------------------------------------------------------------------
// Copyright (C) 2012 - MARIN - All rights reserved - http://www.marin.nl
//----------------------------------------------------------------------------
// Program    : mermaid
// Module     : vbm
// File       : adjustpsi.h
// Author     : M.A. de Jong
//----------------------------------------------------------------------------

#ifndef ADJUSTPSI_H
#define ADJUSTPSI_H

#include "kernels/adjustpsi_kernels.h"

namespace wavescomputer
{

template <class T>
inline void adjustpsi(T* psi, const T* psim1, const T* psim2,
                      const T beta, 
                      const int nx, const int ny, 
                      const int Nx1, const int Nx2)
{
    dimGrid.x = nx / NUM_THREADS_X;
    dimGrid.y = ny / NUM_THREADS_Y;
    dimBlock.x = NUM_THREADS_X;
    dimBlock.y = NUM_THREADS_Y;

    kernel_adjustpsi <<< dimGrid, dimBlock >>> 
        (psi, psim1, psim2,
         beta, nx,
         Nx1, Nx2);
    checkCudaError(cudaGetLastError(), "wavescomputer::kernel_adjustpsi");
}

} // namespace wavescomputer

#endif // ADJUSTPSI_H

